package com.hankol.winecellar.api

import com.baselibrary.net.result.HttpResult
import com.hankol.winecellar.bean.*
import com.baselibrary.base.BasicListBean
import com.hankol.newretail.bean.GoodListBean
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface WineCellarApi {


    /**
     * 酒窖评价列表
     *（全部评价）、评论管理列表
     * @return
     */
    @FormUrlEncoded
    @POST("wineryLabelConfig/v1.0/getWineryCommentList")
    fun requestWineryAllEvaluateList(
        @Field("token") token: String, @Field("wineryCode") wineryCode: String, @Field("page") page: Int, @Field("size") size: Int
    ): Observable<HttpResult<BasicListBean<WineryEvaluateListBean>>>

    /**添加评论
     * @author: merbng
     * @time: 2022/6/23 15:42
     * @description:
     * wineryCode 线上酒窖编号
     * wineryCommentDesc 评价描述
     * wineryCommentImg 评价图片
     * wineryName 酒窖名称
     */
    @FormUrlEncoded
    @POST("wineryLabelConfig/v1.0/addWineryComment")
    fun reqAddComment(
        @Field("token") token: String, @Field("wineryCode") wineryCode: String, @Field("wineryCommentDesc") wineryCommentDesc: String, @Field("wineryCommentImg") wineryCommentImg: String, @Field("wineryName") wineryName: String
    ): Observable<HttpResult<Boolean>>

    @FormUrlEncoded
    @POST("wineryLabelConfig/v1.0/updateWineryComment")
    fun reqEditComment(
        @Field("token") token: String, @Field("id") id: Long, @Field("wineryCode") wineryCode: String, @Field("wineryCommentDesc") wineryCommentDesc: String, @Field("wineryCommentImg") wineryCommentImg: String, @Field("wineryName") wineryName: String
    ): Observable<HttpResult<Boolean>>

    //删除评论
    @FormUrlEncoded
    @POST("wineryLabelConfig/v1.0/deleteWineryComment")
    fun reqDeleteComment(@Field("token") token: String, @Field("id") id: Long): Observable<HttpResult<Boolean>>


    //获取经营者所有酒窖列表
    @FormUrlEncoded
    @POST("wineryDealer/v1.0/getWineryList")
    fun reqgetWineryList(@Field("token") token: String, @Field("phone") phone: String, @Field("dealerCode") dealerCode: String): Observable<HttpResult<List<WineryInfoDataBean>>>

    //附近酒窖 列表
    @FormUrlEncoded
    @POST("wineryData/v1.0/getWineryNearbyList")
    fun reqNearbyWineCellarList(@Field("token") token: String, @Field("province") provinceId: String, @Field("latitude") latitude: Float?, @Field("longitude") longitude: Float?, @Field("page") page: Int, @Field("size") size: Int): Observable<HttpResult<BasicListBean<NearbyWineCellarListBean>>>

    //私房菜管理 列表
    @FormUrlEncoded
    @POST("wineryAppetizer/v1.0/getWineryAppetizerList")
    fun reqPrivateMealList(@Field("token") token: String, @Field("wineryCode") wineryCode: String, @Field("page") page: Int, @Field("size") pageSize: Int): Observable<HttpResult<BasicListBean<PrivateMealManageListBean>>>

    //酒窖内限时秒杀 列表
    @FormUrlEncoded
    @POST("seckill/category/getSeckillWineryActList")
    fun reqSeckillList(@Field("shopId") shopId: Int, @Field("page") page: Int, @Field("size") size: Int): Observable<HttpResult<BasicListBean<WineryGoodsSeckillBean>>>

    /**发布下酒菜
     * @author: merbng
     * @time: 2022/6/23 15:42
     * @description:
    appetizerDesc 下酒菜描述
    appetizerImg 下酒菜图片、视频
    appetizerName 下酒菜名称
    sort 排序
     */
    @FormUrlEncoded
    @POST("wineryAppetizer/v1.0/addWineryAppetizer")
    fun reqAddPrivateMeal(
        @Field("token") token: String, @Field("wineryCode") wineryCode: String, @Field("wineryName") wineryName: String, @Field("appetizerDesc") appetizerDesc: String, @Field("appetizerImg") appetizerImg: String, @Field("appetizerName") appetizerName: String, @Field("sort") sort: Int
    ): Observable<HttpResult<Boolean>>

    //编辑下酒菜
    @FormUrlEncoded
    @POST("wineryAppetizer/v1.0/updateWineryAppetizer")
    fun reqEditPrivateMeal(
        @Field("token") token: String, @Field("id") id: Int, @Field("wineryCode") wineryCode: String, @Field("wineryName") wineryName: String, @Field("appetizerDesc") appetizerDesc: String, @Field("appetizerImg") appetizerImg: String, @Field("appetizerName") appetizerName: String, @Field("sort") sort: Int
    ): Observable<HttpResult<Boolean>>

    //删除下酒菜
    @FormUrlEncoded
    @POST("wineryAppetizer/v1.0/deleteWineryAppetizer")
    fun reqDeletePrivateMeal(@Field("token") token: String, @Field("id") id: Int): Observable<HttpResult<Boolean>>


    //经营者中心-功能列表【酒窖管理，平台服务】
    @FormUrlEncoded
    @POST("wineryConfig/v1.0/getList")
    fun reqConfigCenterList(@Field("token") token: String, @Field("dealerCode") dealerCode: String): Observable<HttpResult<MineCenterMenuBean>>

    //获取经营者信息 dealerCode: 经销商编号
    @FormUrlEncoded
    @POST("wineryDealer/v1.0/getWineryDealerInfo")
    fun reqWineryDealerInfo(
        @Field("token") token: String, @Field("dealerCode") dealerCode: String
    ): Observable<HttpResult<WineryManageInfoDataBean>>

    //编辑酒窖数据回显  wineryId:线上酒窖编号  【酒窖详情】  type 0编辑 1预览（详情）
    @FormUrlEncoded
    @POST("wineryData/v1.0/getWineryDataInfo")
    fun reqgetWineryDataInfo(
        @Field("token") token: String, @Field("type") type: Int, @Field("dealerCode") dealerCode: String, @Field("wineryId") wineryId: String, @Field("latitude") latitude: Float?, @Field("longitude") longitude: Float?
    ): Observable<HttpResult<WineryDataInfoBean>>

    //基础设施列表 0 特色标签 1基础设施标签
    @FormUrlEncoded
    @POST("wineryLabelConfig/v1.0/getList")
    fun reqgetWineryLabelConfig(
        @Field("token") token: String, @Field("type") type: Int
    ): Observable<HttpResult<List<LabelConfigFacilityBean>>>

    //获取线上酒窖管理数据
    @FormUrlEncoded
    @POST("wineryData/v1.0/getWineryDataList")
    fun reqgetWineryManageData(
        @Field("token") token: String, @Field("dealerCode") dealerCode: String, @Field("wineryCode") wineryCode: String, @Field("latitude") latitude: Float?, @Field("longitude") longitude: Float?
    ): Observable<HttpResult<WineryManagerBean>>

    //创建/编辑酒窖数据
    @FormUrlEncoded
    @POST("wineryData/v1.0/updateWineryData")
    fun reqEditWinery(
        @Field("token") token: String, @Field("wineryId") wineryId: String, @Field("wineryImg") wineryImg: String, @Field("winerySlideshow") winerySlideshow: String, @Field("consumptionPrice") consumptionPrice: String, @Field("dealerCode") dealerCode: String, @Field("startTime") startTime: String, @Field("endTime") endTime: String, @Field("wineryDealerPhone") wineryDealerPhone: String, @Field("wineryDesc") wineryDesc: String, @Field("wineryFacility") wineryFacility: String, @Field("wineryFeature") wineryFeature: String
    ): Observable<HttpResult<Boolean>>

    //是否经营者模式
    @FormUrlEncoded
    @POST("wineryDealer/v1.0/getUserWienryStatus")
    fun reqIsWineryManager(
        @Field("token") token: String, @Field("phone") wineryId: String
    ): Observable<HttpResult<Boolean>>

    //修改经营者状态 0未选择 1社区 2经营者
    @FormUrlEncoded
    @POST("wineryDealer/v1.0/updateWineryDealerStatus")
    fun reqChangeWineryManagerStatus(@Field("token") token: String, @Field("wineryStatus") wineryStatus: Int): Observable<HttpResult<Boolean>>

    /**商品管理 列表  售卖中 、已下架
     *type:类型：0售卖中，1已下架
     */
    @FormUrlEncoded
    @POST("dealer/mall/product/v1.31.0/getPager")
    fun requestGoodsManagerList(@Field("type") type: Int, @Field("dealerCode") dealerCode: String, @Field("page") page: Int, @Field("size") pageSize: Int): Observable<HttpResult<BasicListBean<GoodsManagerListBean>>>

    /**
     * 经营者-售后订单列表
     */
    @FormUrlEncoded
    @POST("dealer/mall/aftersale/v1.31.0/getPagerAfterSale")
    fun reqAfterSaleList(@Field("dealerCode") dealerCode: String, @Field("page") page: Int, @Field("size") size: Int): Observable<HttpResult<BasicListBean<GoodsAfterSaleListBean>>>


    /**
     * 经营者--售后单详情
     */
    @FormUrlEncoded
    @POST("mall/aftersale/v1.31.0/loadAfterSale")
    fun reqLoadAfterSale(@Field("afterSaleId") afterSaleId: Long): Observable<HttpResult<AfterSalesInfoBean>>

    //销售订单列表 status:-1-全部，0-待付款，1-待发货，2-待收货,5-已完成
    @FormUrlEncoded
    @POST("dealer/mall/order/v1.31.0/getPager")
    fun reqGoodsOrderList(@Field("dealerCode") dealerCode: String, @Field("status") status: Int?, @Field("keyword") keyword: String, @Field("page") page: Int, @Field("size") size: Int): Observable<HttpResult<BasicListBean<GoodsOrderListBean>>>

    /**
     *经营者-订单详情
     *
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("dealer/mall/order/v1.31.0/load")
    fun requestOrderDetail(@Field("poId") poId: String): Observable<HttpResult<GoodsOrderLoadDetailBean>>

    //快递信息
    @FormUrlEncoded
    @POST("v2/mall/productOrder/queryKuaiDi")
    fun reqLogisticsInfo(@Field("poId") poId: String): Observable<HttpResult<LogisticeInfoBean>>

    //商品分页列表数字统计
    @FormUrlEncoded
    @POST("dealer/mall/product/v1.31.0/statistics")
    fun reqGoodsNumStatistics(@Field("dealerCode") dealerCode: String): Observable<HttpResult<GoodsNumStatisticsBean>>

    //修改排序
    @FormUrlEncoded
    @POST("dealer/mall/product/v1.31.0/modifySort")
    fun reqGoodsModifySort(@Field("sort") sort: String, @Field("spuId") spuId: Int): Observable<HttpResult<SuccessBean>>

    //保存发货信息
    @FormUrlEncoded
    @POST("dealer/mall/order/v1.31.0/saveKuaiDi")
    fun reqSaveSendGoodsInfo(@Field("kuaiDiCom") kuaiDiCom: String, @Field("kuaiDiNum") kuaiDiNum: String, @Field("poId") poId: Int): Observable<HttpResult<SuccessBean>>

    //获取所有快递企业
    @POST("express/v1.31.0/getAllCompony")
    fun reqGetAllCompony(): Observable<HttpResult<MutableList<AllComponyBean>>>

    //经营者客户端关闭未支付超时订单
    @FormUrlEncoded
    @POST("dealer/mall/order/v1.31.0/overtimeNoPayCancel")
    fun reqOvertimeNoPayCancel(@Field("poId") poId: String): Observable<HttpResult<SuccessBean>>

    //经营者客户端调用,超时未接收的订单修改为接收
    @FormUrlEncoded
    @POST("dealer/mall/order/v1.31.0/overtimeReceive")
    fun reqOvertimeReceive(@Field("poId") poId: String): Observable<HttpResult<SuccessBean>>

    //热门城市
    @POST("searchCity/v1.0/getList")
    fun reqGetHotCityList(): Observable<HttpResult<List<HotCityBean>>>
    //根据店铺id查询商品列表
    @FormUrlEncoded
    @POST("v2/mall/product/v1.31.0/getPagerByShopId")
    fun reqAllStoreGoods(@Field("shopId") shopId: Int, @Field("page") page: Int, @Field("size") size: Int,@Field("useSeckill") useSeckill: Int=1): Observable<HttpResult<BasicListBean<GoodListBean>>>

}